import {createStore, applyMiddleware} from 'redux';            // 引入createStore创建store，引入applyMiddleware 来使用中间件
import {composeWithDevTools} from 'redux-devtools-extension'  // 安装redux-devtools-extension的可视化工具。
import reducer from './reducer';  // 引入所有的reducer


// export default () => createStore(reducer, {SWITCH_MENU: ''})
export default () => createStore(
  (state, {type,payload}) => {
  switch (type) {
    case 'SWITCH_MENU':
      return {...state, SWITCH_MENU: payload}
    default:
      return {...state}
  }}, 
  {SWITCH_MENU: ''}
  )